using System;

namespace GURUCORE.Framework.Business
{
	/// <summary>
	/// Exception raise only from Business Service Layer, put BusinessService into the construction method.
	/// </summary>
    [System.Diagnostics.DebuggerStepThrough()]
	public class BusinessException : GURUCORE.Framework.Core.GException
    {
        #region PUBLIC PROPERTIES
        
        private Type m_tServiceClass;
		
        public int Code
        {
            get
            {
                return m_nCode;
            }
        }
        public Type ServiceClass
        {
            get
            {
                return m_tServiceClass;
            }
        }
        
        #endregion
    

        #region CONSTRUCTOR

		public BusinessException()
		{		}

		public BusinessException(Type p_tServiceClass, int p_nCode)
		{
			m_nCode = p_nCode;
			m_tServiceClass = p_tServiceClass;
		}

		public BusinessException(BusinessService p_svcService, int p_nCode)
		{
			m_nCode = p_nCode;
			m_tServiceClass = p_svcService.GetType();
        }

        public BusinessException(string message)
            : base(message)
        {
        }

        public BusinessException(string message, Exception ex)
            : base(message, ex)
        {
        }

        #endregion
    }
}
